:: NickList DLL v1.3 by Epsilon ::For mIRC 6.x and higher.The purpose of NickList DLL is to add a @Window or a dialog as a child into a channel nicklist. It is usefull to make your own custom nicklists or to place elements in the nicklist.NickList DLL also allow you to retrieve the width and the height of a specified nicklist, and it also call an event-alias when the nicklist is resized, to make customisation easier.It can also call the mIRC's nicklist popup on your custom nicklist.CommandsNicklist - GetSize - Popup - DllInfo
:: Nicklist ::Nicklist add a @window or a dialog as a child on the specified channel's nicklist.//dll NickList.dll Nicklist Dialog_name #channelor//dll NickList.dll Nicklist @window #channelThe position of the window/dialog should be 0 0 to fit in the nicklist, but you can set what you want. The width and height of the window can be get with the GetSize command of NickList.Since the child window will always be inactive, and since mIRC's "on mouse" events are only received for active windows, NickList DLL provide his own ON MOUSE event for your custom nicklist,with a SIGNAL, NickList_Mouse. $1 is the @win or dialog name, $2 is the x pos, and $3 is the y pos.example :ON *:SIGNAL:NickList_Mouse:echo -a Mouse moved on $1 at pos. x: $2 and y: $3When the dialog/window will be resized, it will call an signal event called NickList_resize where $1 is the name of the window/dialog, $2 is the width, $3 is the height and $4 is '1' if the child win is a dialog, else $4 is '0'. If you don't want to resize your windows dynamically, you can put something like :/window @nicklist-#channel-78 -2 0 2000 2000wich will cover all the nicklist even if the chan is resized (notice that you should use -2 0 for x y in place of 0 0, because if the Visual Style of mIRC (options > display > options > visual styles) is not set to "No Frames" a line of 1 pixel width of the original nicklist could appear on the left side). This signal is a remote event.I recommend this ON SIGNAL:ON *:SIGNAL:nicklist_resize: {if ($4 == 1) dialog -s $1 0 0 $2 $3else { window $1 -2 0 $calc($2 +2) $3 | drawrect -rf $1 $rgb(81,101,128) 1 0 0 $2 $3 }}This will dynamically resize your nicklist window when the nicklist is resized (the $calc is needed here because the x of the win start at pos -2).Note : You cannot have more than 4000 custom nicklists opened at the same time (but who would use that many...). And you can only have 1 custom nicklist for a channel.Note2 : there is a small bug with the nicklist (wich comes from mIRC), because even if you put 0 0 as coord., the window/dialog will go down if there is too many nicks to fit in the original nicklist. So, to prevent this from happening (in channels with 40+ users usually), you should send yourself the signal NickList_resize when you've got all nicks in a chan (raw 366, end of names) with something like .signal NickList_resize [Name] [width] [height] [IsADialog?] , (assuming that the on signal replace the win to 0 0 coord), or you can replace it manyally to 0 0 with /dialog -s or /window.
:: GetSize ::GetSize return a channel's nicklist width and height. So it has to be called with $dll() to get the value.Example :var %nicklist_size $dll(NickList.dll,GetSize,#channel)window -hp +d @Nicklist-#channel -2 0 %nicklist_size
:: Popup ::Popup will call the mIRC's nicklist popup. It will only work if the mouse is over the custom nicklist and if there is a custom nicklist docked for the channel.If the mouse isn't over the nicklist it will pop up the channel's popup.The name used for the popups parameters ($$1) is the nick selected in the original nicklist ! So you have to use /sline #channel NickNumber to select a nick in the original channel nicklist. (type /help /sline for infos), before you call the dll. You should coordinate the selection of nicks in your custom nicklists with the selection in the original, by doing :if (I select a nick in my nicklist) { sline #channel $nick(#channel,Nick) }You should call the Popup command in a rclick event of you custom nicklist. By example, with a custom @window :menu @nicklist-* {rclick { dll nicklist.dll Popup #channel }}
:: DllInfo ::Returns some info about the DLL and me. It has to be called with $dll() to return a value.//echo -a $dll(NickList.dll,DllInfo,NOT_USED)
:: Usefull tips ::If you are not experienced with picture windows, I suggest you to make a dialog for the custom nicklist. A "picture windowed" nicklist ask lots of skills, but can be better looking.If you use dialogs, you should use MDX, to remove the titlebar of the dialogs, and to have some cool effects available (listviews with icons, and so on). You can find mdx.dll (by DragonZap) here :http://www.dim-bulb.net/~dragonzap/dlls/IF you use window's, i recommend you to init them like this :alias create_nicklist {/var %name @nicklist $+ - $+ $1 $+ - $+ $window($1).cid/window -Bhp +d %name 0 0 $dll(NickList.dll,GetSize,$1)/dll NickList.dll Nicklist %name $1}(like I said before, if you're visual style is not "no frame", you shoud use "-2" as pos x, and add 2 to the width)You can call the alias with something like :ON *:JOIN:#:if ($nick == $me) create_nicklist $chanThe -h is for hide, and no need to activate yourself the window, because NickList will automatically use /window -a when adding the child (a tips for best effect !)The -B is to cut out internal bordersThe -p is for picture windowThe +d is to make a titlebar-less windowThe name is set like this (e.g) : @nicklist-#genscripts-1Because if you have one window/chan you will have to handle each of them, so you cannot simply name it "@nicklist". And the number is the connection ID, since mIRC has multiserv, and because (e.g.) you can have 2 #genscripts on 2 servers at the same time.A last tip :you can get the names of the people on a chan with RAWs :raw 353:*:{ your commands }353 = list of nicks, there can be more than one raw 353 on chan that has lots of people on it.raw 366:*:{ stop storing names because this means that its the end }366 = /end of names listyou'll get these raw ON JOIN, and you can get them anytime with /names #channel.Here a usefull way to display nicks : copying them from the original channel nicklist, with the $nick identifier. You can use $nick(#chan,NumberOfTheNick).pnick to get the nick in the format @nick or +nick.example :raw 366:*: {;this raw means that the list of nicks is completevar %i = 1var %total = $nick($2,0);store the total number of nicks in the channel (the chan is the $2 parameter in raw 366) in the variable %total .while (%i <= %total) {;here put the code to display the nick in your nicklistinc %i}}_____________________________________________Special ThanksA BIG thanks to Naru who helped me a lot with this dll and c++ related stuff.Server : irc.wonderingraven.net Channel : #genscriptsAnd thanks to antygone for being herself. (please visit http://users.pandora.be/Crazy_anty)_____________________________________________ If you have any question, you can e-mail me at blizzard@be.tfHave fun !Epsilon_____________________________________________ versions :24/8/2002 : 1.3 :Changed name from NList to NickList DLL.Added mIRC's nicklist popups support.Added Nicklist_Mouse signal.Changed signal NList resize in NickList_Resize.Improved GetSize method.Removed the limitation of "only a custom nicklist by channel open", now you can close a custom nicklist in a chan and reopen it after without having to close the chan to do that.Removed the dialoged example, since its not compatible anymore...8/8/2002 : 1.2 :Changed alias nlist_resize into a SIGNAL and added an example of a custom nicklist (in the web link above).8/8/2002 : 1.1 :First public release7/8/2002 : 1.0 |